<h1>LLM SSE Client</h1>
<div id="result"></div>

<script>
if(typeof(EventSource) !== "undefined") {
  var evtSource = new EventSource("http://172.17.40.6:9527/api/v1/steam_ask?q=胆石症的治疗应注意什么？");
  evtSource.onmessage = function(event) {
    var msg = JSON.parse(event.data);
    if(msg.status === "stop") {
      evtSource.close();
    }
    document.getElementById("result").innerHTML += msg.content + "<br>";
  };
} else {
  document.getElementById("result").innerHTML = "Sorry, your browser does not support server-sent events...";
}
</script>

</body>
</html>
